#include <gui/GuiImage.h>

GuiImage::GuiImage(Device * device, std::string filename, float x, float y, float width, float height)  {
   _image = LoadResourceFromFile(RM_TEXTURE, filename, device);
   _x = x;
   _y = y;
   _width = width;
   _height = height;
}

void GuiImage::Draw(Device * device, double tElapsed) const {
   Texture * tex = (Texture *) GetResource(_image);
   if (tex){
     device->setTexture(tex->getTexture());
      device->drawRect(_x, _y, _width, _height, 0, 0, 0, 1.0f, 1.0f);
   }
}